<?php
/*
  $Program: ECJC Online Shop
  $Id: admin_configure.php
  $Based on: osCommerce, Open Source E-Commerce Solutions
  Released under the GNU General Public License
*/

  global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_dbprefix;
  global $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db;

  $server_pos = preg_replace('/^(.+?:\/\/)(.+)$/i','$2',$mosConfig_live_site);
  $server_pos_base = preg_replace('/^(.+?)\/.+$/i','$1',$server_pos);
  $server_pos_flag = preg_replace('/^.+?(\/.+)$/i','$1',$server_pos);
  if ($server_pos_flag == $server_pos_base) { $server_pos_flag = ''; };
  if ($server_pos_flag) {
    $http_server = $server_pos_base;
  } else {
    $http_server = $server_pos;
  };

  // Define the database connection parameters

    // eg, localhost - Should NOT be EMPTY
    define('DB_SERVER',             $mosConfig_host);
    define('DB_SERVER_USERNAME',    $mosConfig_user);
    define('DB_SERVER_PASSWORD',    $mosConfig_password);
    define('DB_DATABASE',           $mosConfig_db);

    // 0 = MOS and OSC using different databases ( flags DB reconnects )
    // 1 = Using same database as MOS
    define('DB_SHARED',             1);

    // Prefix for Tables in Database
    define('DB_PREFIX',             $mosConfig_dbprefix.'osc_');

    // Use Persistent connections?
    define('USE_PCONNECT',          '');

    // Database Handler - '' for default handler or 'mysql'
    define('STORE_SESSIONS',        'mysql');

  // Define the webserver and path parameters
  //
  // * DIR_WS_* = Webserver directories  (virtual/URL)
  // * DIR_FS_* = Filesystem directories (local/physical)
  //

    // Enable Secure SSL for Catalog
    define('ENABLE_SSL_CATALOG',        true);

    // This is the URL of your ADMIN webserver
    define('HTTP_SERVER',               'http://' . $http_server);

    // This is the URL of your PUBLIC Catalog webserver
    define('HTTP_CATALOG_SERVER',       'http://' . $http_server);
    define('HTTPS_CATALOG_SERVER',      'https://' . $http_server);

    // Absolute Server Path to WWW folder
    define('DIR_FS_HTTP_ROOT',          $mosConfig_absolute_path . '/');

    // Relative to Administrator Root
    define('DIR_WS_COMPONENT',          'components/com_oscommerce/');

    // Absolute Server Path to Administrator Files
    define('DIR_FS_ADMIN',              DIR_FS_HTTP_ROOT . 'administrator/' . DIR_WS_COMPONENT);

    // Absolute Server Path to Catalog Documents
    define('DIR_FS_DOCUMENT_ROOT',      DIR_FS_HTTP_ROOT . DIR_WS_COMPONENT);

    // Absolute Server Path to Catalog Files
    define('DIR_FS_CATALOG',            DIR_FS_HTTP_ROOT . DIR_WS_COMPONENT);

    // Relative Server Path to Administrator Files
    define('DIR_WS_ADMIN',              $server_pos_flag . '/administrator/');

    // Relative Server Path to Catalog Files
    define('DIR_WS_CATALOG',            $server_pos_flag . '/');

  //-- DO NOT MODIFY BELOW THIS LINE -----------------------------------------------------------------------

    define('DIR_WS_IMAGES',             DIR_WS_COMPONENT . 'images/');
      define('DIR_WS_ICONS',              DIR_WS_IMAGES   . 'icons/');

    define('DIR_WS_INCLUDES',           DIR_WS_COMPONENT . 'includes/');
      define('DIR_WS_BOXES',              DIR_WS_INCLUDES . 'boxes/');
      define('DIR_WS_FUNCTIONS',          DIR_WS_INCLUDES . 'functions/');
      define('DIR_WS_CLASSES',            DIR_WS_INCLUDES . 'classes/');
      define('DIR_WS_MODULES',            DIR_WS_INCLUDES . 'modules/');
      define('DIR_WS_LANGUAGES',          DIR_WS_INCLUDES . 'languages/');

    define('DIR_WS_CATALOG_IMAGES',     DIR_WS_CATALOG . DIR_WS_COMPONENT . 'images/');
    define('DIR_WS_CATALOG_LANGUAGES',  DIR_WS_CATALOG . DIR_WS_COMPONENT . 'includes/languages/');

    define('DIR_FS_CATALOG_LANGUAGES',  DIR_FS_CATALOG . 'includes/languages/');
    define('DIR_FS_CATALOG_IMAGES',     DIR_FS_CATALOG . 'images/');
    define('DIR_FS_CATALOG_MODULES',    DIR_FS_CATALOG . 'includes/modules/');
    define('DIR_FS_BACKUP',             DIR_FS_ADMIN   . 'backups/');
?>
